#define  _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    int singleNumber(vector<int>& nums) {
        int ret = 0;
        for (int i = 0; i < 32; i++)
        {
            size_t cur = 0;
            for (auto e : nums) if ((size_t)e & (1 << i))cur++;
            if (cur % 3) ret |= (1 << i);
        }
        return ret;
    }
};